package com.frogs.ucenter.util.record;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import com.alibaba.druid.support.logging.Log;
import com.alibaba.fastjson.JSON;
import com.frogs.system.web.api.entity.FeedsRecordActiveMqEntity;
import com.frogs.ucenter.v1.service.UserFeedsService;

/**
 * 接收用户动态记录
 * @author houlong
 *
 */
@Component("feedsRecordActiveMqReceive")
public class FeedsRecordActiveMqReceive {
	private static final Logger logger = LoggerFactory.getLogger(FeedsRecordActiveMqReceive.class);
	@Resource
	private UserFeedsService userFeedsService;
	/**
	 * 接收到队列消息，然后插入动态记录
	 * @param activeMqEntity
	 */
	public void addUserFeedsRecord(FeedsRecordActiveMqEntity activeMqEntity){
		logger.info("activeMQ接收端接收到数据，数据为："+JSON.toJSONString(activeMqEntity));

		userFeedsService.insertFeedsRecordList(activeMqEntity);
	}
}
